// import { AppRegistry } from 'react-native';
// import SignInPage from './src/pages/signin';

// AppRegistry.registerComponent('xxxx', () => SignInPage);


import React, { Component } from 'react';
import {
  Platform,
  AppRegistry,
  Text,
  Button,
  View,
} from 'react-native';
import { StackNavigator } from 'react-navigation';
import SignInPage from './src/pages/signin';

class HomeScreen extends React.Component {
  static navigationOptions = {
    title: 'Welcome',
  };
  render() {
    const { navigate } = this.props.navigation;
    return (
      <View>
        <Text>Hello, Navigation!</Text>
        <Button
          onPress={() => navigate('Chat', { user: 'ifreom' })}
          title="Chat with Lucy"
        />
      </View>
    )
  }
}
class ChatScreen extends React.Component {
  static navigationOptions = ({ navigation }) => ({
    title: `Chat with ${navigation.state.params.user}`,
  });
  render() {
    const { params } = this.props.navigation.state;
    const { navigate } = this.props.navigation;
    return (
      <View>
        <Text>Chat with {params.user}</Text>
        <Button
          onPress={() => navigate('Signin', { user: 'ifreom2' })}
          title="Chat with Lucy"
        />
      </View>
    );
  }
}

const SimpleApp = StackNavigator({
  Home: { screen: HomeScreen },
  Chat: { screen: ChatScreen },
  Signin: { screen: SignInPage }
});

AppRegistry.registerComponent('xxxx', () => SimpleApp)